<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>我的信息</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <link rel="stylesheet" href="/js/bootstrap/css/bootstrap.min.css">
    <script src="/js/jquery/jquery.min.js"></script>
    <script src="/js/bootstrap/js/bootstrap.min.js"></script>
    <link rel="stylesheet" href="/css/font/css/font-awesome.min.css"/>
    <link rel="stylesheet" href="/css/reset.css"/>
    <link rel="stylesheet" href="/css/message.css" />
    <script src="/js/plugins/jrender/jrender.min.js"></script>
    <link rel="stylesheet" href="/js/plugins/dialog2/dialog.css"/>
    <script src="/js/plugins/dialog2/dialog.min.js"></script>
    <script>
        $(function () {
            var user = JSON.parse(sessionStorage.getItem("user"));
            $.get("/users/"+user.id+"/friends",function (data) {
                var json = {
                    list:data
                }
                $("#receivers").renderValues(json);
            });
            
            $(".confirm").click(function () {
                var pointedFriends=$.map($(".getCheckbox input:checked"),function (ele,index) {
                    return ele.value;
                })
                sessionStorage.setItem("pointedFriends",pointedFriends);
                location.href="/mine/addDynamic.html";
            })
        });
    </script>
</head>
<body>
<div class="search-head">
    <div class="row nav-search">
        <div class="col">
            <a href="/mine/addDynamic.html">
                <span><i class="fa fa-chevron-left" ></i></span>
            </a>
        </div>
        <div class="col">
            <span>指定谁可见</span>
        </div>
        <div class="col"></div>
    </div>
</div>
<div id="receivers">
    <div render-loop="list">
        <ul class="list-group">
            <a>
                <li class="list-group-item d-flex justify-content-between align-items-center getCheckbox">
                    <div class="item">
                        <img render-src="list.headImgUrl" width="30px"/>
                        <span render-html="list.nickName"></span>
                    </div>
                    <input type="checkbox" name="pointedPersonId" render-value="list.id">
                </li>
            </a>
        </ul>
    </div>
    <button type="button" class="btn btn-success confirm" style="border-left-width: 1px;margin-left: 230px;margin-top: 10px;">
        <span class="glyphicon glyphicon-search"></span> 确定
    </button>
    <button type="button" class="btn btn-primary unconfirm" style="margin-top: 10px;">
        <span class="glyphicon glyphicon-search"></span> 取消
    </button>
</div>
</body>
</html>